<extend name="Public/layout"/>
<block name="style" >
    <link rel="stylesheet" type="text/css" href="__LYUI__/css/lyui.extend.min.css">
    <link rel="stylesheet" type="text/css" href="__ADMIN_CSS__/style.css">
</block>

<block name="main">
   <div id="main" class="col-xs-12 col-sm-9 main" style="overflow-y: scroll;">
        <ul class="breadcrumb">
            <li><i class="fa fa-map-marker"></i></li>

            <li class="text-muted">商户管理 /  编辑商户</li>

        </ul>

        <!-- 主体内容区域 -->
        <div class="tab-content ct-tab-content">
            <div class="panel-body">
                <div class="builder formbuilder-box">
                    <div class="form-group"></div>
                    <div class="builder-container" >
                            <div class="row" >
                                <div class="col-xs-12">
                                    <form action="__SELF__" method="post" class="form-horizontal form form-builder">
                                        <div class="form-type-list">
                                            
                                          
                                            <div class="form-group item_title ">
                                                <label class="left control-label">商户名：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input" name="username" v placeholder="商户名" value="<?=$info['names']?>"  required="required" >
                                                </div>
                                            </div>
                                         
                                            <div class="form-group item_title ">
                                                <label class="left control-label">商户秘钥：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input text" id="key" name="key"placeholder="商户秘钥" value="<?=$info['key']?>"   required="required" >
                                                    <a href="JavaScript:" style="float: left;" id="scmy">生成秘钥</a>
                                                </div>
                                            </div>

                                             <div class="form-group item_title ">
                                                <label class="left control-label">商户网址（不要http://）：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input text" name="url"placeholder="商户网址" value="<?=$info['url']?>" required="required" >
                                                    
                                                </div>
                                            </div>

                                            <input type="hidden" name="id" value="<?=$info['id']?>">
                                          
                                            <div class="form-group item_title ">
                                                <label class="left control-label">登录密码：</label>
                                                <div class="right">
                                                    <input type="password"  class="form-control input text" name="pwd" placeholder="不修改就留空" required="required" >
                                                </div>
                                            </div>
   

                                             <div class="form-group item_title ">
                                                <label class="left control-label">微信费率（%）：</label>
                                                <div class="right">
                                                    <input type="text"  value="<?=$info['wx']?>"  class="form-control input text" name="wx" placeholder="微信费率" required="required" >
                                                </div>
                                            </div>

                                            <div class="form-group item_title ">
                                                <label class="left control-label">支付宝费率（%）：</label>
                                                <div class="right">
                                                    <input type="text" value="<?=$info['zfb']?>" class="form-control input text" name="zfb" placeholder="支付宝费率" required="required" >
                                                </div>
                                            </div>

                                            <div class="form-group item_title ">
                                                <label class="left control-label">商家码费率（%）：</label>
                                                <div class="right">
                                                    <input type="text"  value="<?=$info['sjm']?>" class="form-control input text" name="sjm" placeholder="商家码费率"  required="required"   >
                                                </div>
                                            </div>

                                            <div class="form-group item_title ">
                                                <label class="left control-label">商户余额：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input text" name="money"placeholder="商户余额" value="<?=$info['money']?>" required="required" >
                                                    
                                                </div>
                                            </div>

                                             <div class="form-group item_title ">
                                                <label class="left control-label">商户收款银行：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input text" name="bankname"placeholder="商户收款银行" value="<?=$info['bankname']?>" required="required" >
                                                    
                                                </div>
                                            </div>

                                             <div class="form-group item_title ">
                                                <label class="left control-label">商户收款银行信息：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input text" name="bankinfo"placeholder="商户收款银行信息" value="<?=$info['bankinfo']?>" required="required" >
                                                    
                                                </div>
                                            </div>

                                             <div class="form-group item_title ">
                                                <label class="left control-label">商户收款银行户名：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input text" name="name"placeholder="商户收款银行户名" value="<?=$info['name']?>" required="required" >
                                                    
                                                </div>
                                            </div>

                                            <div class="form-group item_title ">
                                                <label class="left control-label">商户收款银行卡号：</label>
                                                <div class="right">
                                                    <input type="text" class="form-control input text" name="acc"placeholder="商户收款银行卡号" value="<?=$info['acc']?>" required="required" >
                                                    
                                                </div>
                                            </div>




                                            <div class="form-group item_title ">
                                                <label class="left control-label">商家状态：</label>
                                                <div class="right">
                                                    <input type="radio"  name="zt" 
                                                    <?php if($info['zt'] == 1){ ?>  checked="checked" <?php } ?>
                                                     value="1" >正常

                                                    <input type="radio"  <?php if($info['zt'] == 0){ ?>  checked="checked" <?php } ?> name="zt"  value="0" >停用
                                                </div>
                                            </div>


             
                                        <div class="form-group"></div>
                                        <div class="form-group bottom_button_list">
                                            <a class="btn btn-primary submit ajax-post" type="submit" target-form="form-builder">修改</a>
                                            <a class="btn btn-danger return" onclick="javascript:history.back(-1);return false;">取消</a>
                                        </div>
                                    </div>
                                </form>
                            </div>    
                        </div>
                    </div>
                </div>
        </div>
    </div>                   
</div>
</block>

<block name="script">
    <script type="text/javascript" src="__LYUI__/js/lyui.extend.min.js"></script>
    <script>

    function randomWord(randomFlag, min, max) {
	    var str = "",
	        range = min,
	        arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
	    // 随机产生
	    if (randomFlag) {
	        range = Math.round(Math.random() * (max - min)) + min;
	    }
	    for (var i = 0; i < range; i++) {
	        pos = Math.round(Math.random() * (arr.length - 1));
	        str += arr[pos];
	    }
	    return str;
	}

	$("#scmy").click(function(){

		 var key = randomWord(true,32,32);
         
         $("#key").val(key);

	})






    </script>
</block>